]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: Use correct padding for items with hidden ornaments
authorSebastian Keller <skeller@gnome.org>
Wed, 17 May 2023 20:49:34 +0000 (22:49 +0200)
committerMarge Bot <marge-bot@gnome.org>
Tue, 1 Aug 2023 17:32:53 +0000 (17:32 +0000)
This also restores the padding adjustments that were erroneously removed
in a0fde0ee, but now they only apply to ornamented items.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2843>

data/theme/gnome-shell-sass/widgets/_popovers.scss
js/ui/popupMenu.js

index 92588f28790cd4bb38cf816dde5f05a227874452..a6ed06d3adf62cdfec5c4e681e43e3393304b0d4 100644 (file)
@@ -53,6 +53,10 @@ $submenu_bg_color: lighten($menu_bg_color, 7%);
   }
 }
 
+.popup-ornamented-menu-item {
+  &:ltr {padding-left: $base_padding;}
+  &:rtl {padding-right: $base_padding;}
+}
 
 // all other graphical elements (sliders)
 .popup-inactive-menu-item {
index 547ce08f4f19f58286a34c23b2d57a93d3ef06fa..9033c9044db0415fffed2c90ff53aae0169f7b80 100644 (file)
@@ -94,9 +94,9 @@ var PopupBaseMenuItem = GObject.registerClass({
         });
         this._delegate = this;
 
-        this._ornament = Ornament.NONE;
         this._ornamentIcon = new St.Icon({style_class: 'popup-menu-ornament'});
         this.add(this._ornamentIcon);
+        this.setOrnament(Ornament.NONE);
 
         this._parent = null;
         this._active = false;
@@ -256,6 +256,14 @@ var PopupBaseMenuItem = GObject.registerClass({
         }
 
         this._ornamentIcon.visible = ornament !== Ornament.HIDDEN;
+        this._updateOrnamentStyle();
+    }
+
+    _updateOrnamentStyle() {
+        if (this._ornament !== Ornament.HIDDEN)
+            this.add_style_class_name('popup-ornamented-menu-item');
+        else
+            this.remove_style_class_name('popup-ornamented-menu-item');
     }
 });